﻿using System;

class SortingStringArray
{
    static void Main()
    {
        string[] strArray = { "Georgi", "Yani", "Stanislav", "Ivo", "Konstantin", "Pesho", "Kiro", "Denica" };        

        // Ascending sorting
        SortingStrArray(strArray);

        // Printing the array on the console
        for (int i = 0; i < strArray.Length; i++)
        {
            Console.WriteLine(strArray[i]);
        }
    }

    private static void SortingStrArray(string[] strArray)
    {
        int length = strArray.Length;

        for (int i = 0; i < length - 1; i++)
        {
            for (int k = i + 1; k < length; k++)
            {
                if (strArray[k].Length < strArray[i].Length)
                {
                    string arrElement = strArray[i];
                    strArray[i] = strArray[k];
                    strArray[k] = arrElement;
                }
            }
        }
    }
}
